public class Largest_number_of_water {

        public int maxArea(int[] height) {
            int left = 0;
            int right = height.length-1;
            int max = 0;
            while(left<right){
                int vet = Math.min(height[left],height[right])*(right-left);
                max = Math.max(vet,max);
                if(height[left]<height[right]){
                    left++;
                }
                else{
                    right--;
                }
            }
            return max;
        
    }
}
